<ion-header>
  <ion-toolbar color="primary">
    <ion-navbar>
      <ion-row>
        <ion-title>数据上传</ion-title>
        <div (click)="goOnline()" ion-button color="light" clear>
          <ion-icon name="log-in"></ion-icon>&nbsp;
          切换到在线功能
        </div>
      </ion-row>
    </ion-navbar>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-card [hidden]="pageOneTag">
    <ion-card-header>
      登录确定用户
    </ion-card-header>
    <ion-card-content>
      <ion-list>
        <ion-item>
          <ion-input type="text" placeholder="用户名" [(ngModel)]="userName"></ion-input>
        </ion-item>

        <ion-item>
          <ion-input type="password" placeholder="密码" [(ngModel)]="pwd"></ion-input>
        </ion-item>
      </ion-list>

      <ion-row>
        <ion-col col-6>
          <button ion-button full (click)="doLogin()" id="dologin">
            <ion-icon name="log-in"></ion-icon>&nbsp;
            登录
          </button>
        </ion-col>
        <ion-col col-6>
          <button ion-button full (click)="scanLogin()">
            <ion-icon name="barcode"></ion-icon>&nbsp;
            扫码登录
          </button>
        </ion-col>
      </ion-row>
    </ion-card-content>
  </ion-card>

  <ion-card [hidden]="!pageOneTag">
    <ion-card-content>
      <ion-card-title>
        用户信息
      </ion-card-title>
      <ion-row>
        <ion-col col-6 text-left>
          <h5>用户名:</h5>
        </ion-col>
        <ion-col col-6 text-right>
          <h5>{{user.name}}</h5>
        </ion-col>
      </ion-row>

      <ion-row>
        <ion-col col-6 text-left>
          <h5>所属公司:</h5>
        </ion-col>
        <ion-col col-6 text-right>
          <h5>{{user.company}}</h5>
        </ion-col>
      </ion-row>

      <button ion-button full clear (click)="switchUser()">切换用户</button>

    </ion-card-content>
  </ion-card>

  <ion-card [hidden]="!pageOneTag||pageTwoTag">
    <ion-card-header>
      选择项目信息
    </ion-card-header>
    <ion-card-content>

      <ion-item>
        <ion-label>选择项目</ion-label>
        <ion-select [(ngModel)]="projectId" okText="确认" cancelText="取消" (ionChange)="selectChange('project',$event)">
          <ion-option *ngFor="let item of projectshow " [value]="item.id">{{item.name}}</ion-option>
        </ion-select>
      </ion-item>

      <ion-item>
        <ion-label>选择计划</ion-label>
        <ion-select [(ngModel)]="planId" okText="确认" cancelText="取消" (ionChange)="selectChange('plan',$event)">
          <ion-option *ngFor="let item of planshow" [value]="item.id">{{item.name}}</ion-option>
        </ion-select>
      </ion-item>

      <ion-item>
        <ion-label>选择地点</ion-label>
        <ion-select [(ngModel)]="positionId" okText="确认" cancelText="取消" (ionChange)="selectChange('position',$event)">
          <ion-option *ngFor="let item of positionshow " [value]="item.id">{{item.name}}</ion-option>
        </ion-select>
      </ion-item>
      <button ion-button full (click)="confirmProject()">完成</button>

    </ion-card-content>
  </ion-card>

  <ion-card [hidden]="projectInfoTag">
    <ion-card-content>
      <ion-card-title>
        项目信息
      </ion-card-title>
      <ion-row>
        <ion-col col-4 text-left>
          <h5>项目名称:</h5>
        </ion-col>
        <ion-col col-8 text-right>
          <h5>{{projectName}}</h5>
        </ion-col>
      </ion-row>

      <ion-row>
        <ion-col col-4 text-left>
          <h5>计划编码:</h5>
        </ion-col>
        <ion-col col-8 text-right>
          <h5>{{planName}}</h5>
        </ion-col>
      </ion-row>

      <ion-row>
        <ion-col col-4 text-left>
          <h5>业务地点:</h5>
        </ion-col>
        <ion-col col-8 text-right>
          <h5>{{positionName}}</h5>
        </ion-col>
      </ion-row>

      <button ion-button full clear (click)="switchPorject()">重新选择</button>
    </ion-card-content>
  </ion-card>

  

</ion-content>


<ion-footer>
  <ion-row>
    <ion-col col-6>
      <button ion-button full [disabled]="uploadBtnTag" (click)="dataUpload()">
        <ion-icon name="cloud-upload"></ion-icon>&nbsp;
        数据上传
      </button>
    </ion-col>
    <ion-col col-6>
      <button ion-button full color="light" (click)="goBack()">返回</button>
    </ion-col>
  </ion-row>
</ion-footer>